<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>File: yubico.rb</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



  <div id="fileHeader">
    <h1>yubico.rb</h1>
    <table class="header-table">
    <tr class="top-aligned-row">
      <td><strong>Path:</strong></td>
      <td>yubico.rb
      </td>
    </tr>
    <tr class="top-aligned-row">
      <td><strong>Last Update:</strong></td>
      <td>Mon Oct 29 12:50:03 -0700 2007</td>
    </tr>
    </table>
  </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
Yubico.rb - yubikey authentication library Protected under the BSD License.
</p>
<p>
Author: Jenecai &#8216;Seven&#8217; Corvina &lt;seven@ofhearts.org&gt;
</p>
<p>
Documentation: Jenecai &#8216;Seven&#8217; Corvina
</p>
<h2>Overview</h2>
<p>
The Yubikey is a simple tool to for which to authenticate users without the
hassle of usernames or passwords, in a secure manner. Using OTP, the
Yubikey is a strong cryptographic tool which, through various APIs, calls
home to a server, parses the OTP token, and responds with authority.
</p>
<h2>Introduction</h2>
<p>
The Yubikey was designed for ease-of-use as well as ease-of-implementation;
a veritable solution for all interests where authentication, identity and
anonymity are desired or needed. For that logic, the implementation of the
API falls under the same concept.
</p>
<p>
Basic usage of the <a href="../classes/Yubico.html">Yubico</a> module
follows the simple Objective concept. Requests centralize about the shared
key, so the object you create is singular to that shared secret. The shared
secret provided to you as a client service is passed, with your client ID,
to the object, to create the instance. (This object will be used in all the
documentation following.)
</p>
<pre>
 shared_secret = &quot;Th1sIZ4f4k3K3y=&quot;
 yk = Yubico.new 2, shared_secret
   # =&gt; #&lt;Yubico:0x5841d4 @_id=2, @_key=&quot;Th1sIZ4f4k3K3y=&quot;&gt;
</pre>
<p>
This will initialize the object, provide the two variables @_id and @_key,
which are used extensively through the code. If you only need to be
verifying your keys, which are not signed requests, it is highly
recommended that you do not pass your key.
</p>
<p>
yk = <a href="../classes/Yubico.html#M000001">Yubico.new</a> 2
</p>
<pre>
  # =&gt; #&lt;Yubico:0x58bd08 @_id=2, @_key=&quot;&quot;&gt;
</pre>
<p>
This initializes an object that will make verify requests, but will always
return <tt>E_MISSING_SECRET</tt> when a signed request is called.
</p>
<h2>Signatures</h2>
<p>
Signatures are handled via HMAC SHA1.
</p>
<h2>To Be Implemented</h2>
<p>
Client Manipulation and Key Manipulation classes:
</p>
<pre>
  user = Yubikey.new(1)
  res = user.addClient( email, timestamp, nonce, hash, id, verify ) -- Implemented in Server
    # =&gt; [ &quot;client_id&quot; =&gt; 2, &quot;h&quot; =&gt; &quot;L+ReU3MJBrBUO+BBsN4gsafu75E=&quot;, &quot;t&quot; =&gt; &quot;2007-10-03T11:37:17Z&quot;,
      &quot;shared_secret&quot; =&gt; &quot;xUDbj73PXokSh5rTpFdDVDIS6gw=&quot;, &quot;nonce&quot; =&gt; &quot;xyz&quot;, &quot;status&quot; =&gt; &quot;OK&quot;, &quot;operation&quot; =&gt; &quot;add_client&quot; ]
  res = user.deleteClient() -- Not Yet in Server
  res = user.addKey( timestamp, nonce, hash, id )  -- Implemented in Server
    # =&gt; [ &quot;user_id&quot; =&gt; &quot;FUM6HzSS&quot;, &quot;h&quot; =&gt; &quot;3v9LI0HZn52aTyrOalLO0FxrZGg=&quot;, &quot;t&quot; =&gt; &quot;2007-10-03T11:37:17Z&quot;,
      &quot;shared_secret&quot; =&gt; &quot;EhkFIgxhOVP9RmROBcpHVg==&quot;, &quot;token_id&quot; =&gt; &quot;mVeEEWFzhLU=&quot;, &quot;nonce&quot; =&gt; &quot;abc&quot;,
      &quot;status&quot; =&gt; &quot;OK&quot;, &quot;operation&quot; =&gt; &quot;add_key&quot; ]
  res = user.deleteKey() -- Not Yet Implemented in Server
</pre>

    </div>

    <div id="requires-list">
      <h3 class="section-bar">Required files</h3>

      <div class="name-list">
      net/http&nbsp;&nbsp;
      uri&nbsp;&nbsp;
      digest/sha1&nbsp;&nbsp;
      digest/md5&nbsp;&nbsp;
      openssl&nbsp;&nbsp;
      </div>
    </div>

   </div>


  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>